package service;

import Util.SqlSessionUtil;
import dao.NingboIncomeExpenditureMapper;
import dao.ZhejiangIncomeExpenditureMapper;
import domain.NingboIncomeExpenditure;
import domain.ZhejiangIncomeExpenditure;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ZhejiangIEService {
    public List<ZhejiangIncomeExpenditure> selectDataByCityAndYear(String city, Integer year){
        SqlSession session = SqlSessionUtil.getSession().openSession();
        ZhejiangIncomeExpenditureMapper operation = session
                .getMapper(ZhejiangIncomeExpenditureMapper.class);
        List<ZhejiangIncomeExpenditure> zjieList = operation.selectByCityAndYear(city, year);
        session.commit();
        session.close();
        return zjieList;
    }

    public static void main(String[] args) {
        ZhejiangIEService n = new ZhejiangIEService();
        System.out.println(n.selectDataByCityAndYear("宁波", 2016));
    }
}
